Merge branch 'master' into ospath
authorJoey Hess <joeyh@joeyh.name>
Thu, 30 Jan 2025 19:07:17 +0000 (15:07 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 30 Jan 2025 19:07:17 +0000 (15:07 -0400)
1  2 
doc/todo/RawFilePath_conversion.mdwn

index 3676495fd6b763e7d29f6427f9d8ab2a6889d700,46c9bc3bbed2466c227d647aa548692303e3d2e4..8cd441d50f0a35b2edcd288650ea59bc392088f5
@@@ -17,27 -17,8 +17,18 @@@ status
    replacing all the RawFilePath with OsPath, which should be pretty
    mechanical, with only some wrapper functions in Utility.FileIO and
    Utility.RawFilePath needing to be changed.
- * Utility.FileIO is used for most withFile and openFile, but not yet for
-   readFile, writeFile, and appendFile on FilePaths.
-   Note that the FilePath versions do newline translation on windows, 
-   which has to be handled when converting to the Utility.FileIO ones.
- * System.Directory.OsPath is available with OsPath build flag, but
-   not yet used, and would eliminate a lot of fromRawFilePaths.
-   Make Utility.SystemDirectory import it when built with OsPath,
-   and the remaining 6 hours or work will explain itself..
-   This has been started in the `ospath` branch.
 -
 -  Work on this is underway, in the `ospath` branch.
 +* As part of the OsPath conversion, Git.LsFiles has several
 +  `pipeNullSplit'` calls that have toOsPath mapped over the results.
 +  That adds an additional copy, so the lazy ByteString is converted to strict,
 +  and then to ShortByteString, with a copy each time. This is in the
 +  critical path for large git repos, and might be a noticable slowdown.
 +  There is currently no easy way to go direct from a lazy ByteString to a
 +  ShortByteString, although it would certianly be possible to write low
 +  level code to do it efficiently. Alternatively, it would be possible to
 +  read a strict ByteString direct from a handle, like hGetLine does
 +  (although in this case it would need to stop at the terminating 0 byte)
 +  and unsafePerformIO to stream to a list would avoid needing to rewrite
 +  this code to not use a list.
  
  [[!tag confirmed]]